<!-- 
  @author: 善良的YWJ
  @Created by shanliangdeYWJ on 2021/07/11 17:44:24
  @file: EditTodo.vue
  @description:
  ```
  EditTodo
  修改如下
  <input
    v-model="newTodo"
    type="text"
    autofocus
    placeholder="新增今日待办"
    autocomplete="off"
    @keyup.enter="addTodo"
  />
  ```
  @link [Github](https://github.com/shanliangdeYWJ)
-->

<template>
  <input
    :value="todoTitle"
    type="text"
    v-bind="$attrs"
    @input="onInputChange"
  />
</template>

<script>
export default {
  name: "EditTodo",
  props: {
    todoTitle: {
      type: String,
      default: "",
    },
  },
  emits: ["update:todo-title"],
  methods: {
    onInputChange(e) {
      this.$emit("update:todo-title", e.target.value);
    },
  },
};
</script>

<style></style>
